package com.ws.test;

import java.util.List;

import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.MediaType;

import org.codehaus.jackson.jaxrs.JacksonJsonProvider;

import com.ws.model.Users;

public class JAXRS20Client {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
        String baseAddress = "http://localhost:8080/cxf/ws/rest";

        JacksonJsonProvider jsonProvider = new JacksonJsonProvider();

        List<Users> usersList = ClientBuilder.newClient()
            .register(jsonProvider)
            .target(baseAddress)
            .path("/users/get")
            .request(MediaType.APPLICATION_JSON)
            .get(List.class);
        for (Object users : usersList) {
            System.out.println(users);
        }
    }
}